/*
* $Id: SqlBinder.h 134 2010-08-26 11:32:19Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Aleksey
* All rights reserved
*
*/
#ifndef _SQL_BINDER_H_
#define _SQL_BINDER_H_

class CSqlBinder
{
	std::tstring m_strRequest;
	std::vector<int> m_aPosition;
	std::tstring m_strRequestTemp;
	std::map<int, std::tstring> m_aParameters;
	void ParseString();
	void SetString(int nPos, const std::tstring& value);
public:
	CSqlBinder();
	CSqlBinder(const std::tstring& strRequest);
	~CSqlBinder();
	std::tstring GetRequest();
	void ClearParameters();
	void SetRequest(const std::tstring& strRequest);
	void SetValue(int nPos, int value);
	void SetValue(int nPos, void* value);
	void SetValue(int nPos, const std::tstring& value);
	void SetValue(int nPos, TCHAR* value);
	void SetValue(int nPos, __int64 value, bool bTime);
	void SetValue(int nPos, unsigned int value);
	void SetValue(int nPos, unsigned __int64 value);
	void SetValue(int nPos, double value);
	void SetValue(int nPos);
};

#endif/*_SQL_BINDER_H_*/